import http from "./http.js";
import config from "@/config/index.config.js";

// 获取OpenId
export const getOpenId = (data) => http.GET(`${config.baseUrl}/user/getOpenId`, data);
// 绑定手机号
export const bindPhoneForWx = (data) => http.GET(`${config.baseUrl}/user/bindPhoneForWx`, data);
// 小程序授权登录
export const xcxUserLogin = (data) => http.POST(`${config.baseUrl}/user/wxUserLogin`, data);
// // 获取用户资料
// export const getUserInfo = (data) => http.GET(`${config.baseUrl}/user/getUserInfo`, data);
// // 用户角色切换
// export const switchRole = (data) => http.POST(`${config.baseUrl}/user/switchRole`, data);


// 新增简历信息
export const addResume = (data) => http.POST(`${config.baseUrl}/resume/addResume`, data);
// 查询简历信息
export const getResumeInfo = (id) => http.GET(`${config.baseUrl}/resume/getResumeInfo/${id}`);
// // 查询用户简历
// export const getUserResume = (data) => http.GET(`${config.baseUrl}/resume/getUserResume`, data);
// 更新简历信息
// export const updateResume = (data) => http.POST(`${config.baseUrl}/resume/updateResumeInfo`, data);
// // 获取简历列表
// export const getResumeList = (data) => http.POST(`${config.baseUrl}/resume/getResumeList`, data);

// // 查询工作列表
// export const getJobList = (data) => http.POST(`${config.baseUrl}/job/getJobList`, data);
// 新增工作信息
export const addJob = (data) => http.POST(`${config.baseUrl}/job/addJob`, data);
// 更新工作信息
export const updateJobInfo = (data) => http.POST(`${config.baseUrl}/job/updateJobInfo`, data);
// 删除工作信息
export const deleteJob = (id) => http.DELETE(`${config.baseUrl}/job/deleteJob/${id}`);

// // 查询行业列表
// export const getIndustryList = (data) => http.POST(`${config.baseUrl}/industry/getIndustryList`, data);
// // 查询职位列表
// export const getPositionList = (data) => http.POST(`${config.baseUrl}/position/getPositionList`, data);
// 查询福利列表
export const getWelfareList = (data) => http.POST(`${config.baseUrl}/welfare/getWelfareList`, data);



// 新增/更新职位信息
export const updatePosition = (data) => http.POST(`${config.baseUrl}/company/updatePosition`, data);
// 查询职位信息
export const getPositionDetail = (data) => http.GET(`${config.baseUrl}/company/getPositionDetail`, data);
// 删除公司职位
export const deletePositionById = (data) => http.GET(`${config.baseUrl}/company/deletePositionById`, data);




// 新增浏览信息
export const addBrowse = (data) => http.POST(`${config.baseUrl}/browse/addBrowse`, data);
// 获取浏览信息
export const getBrowseList = (data) => http.POST(`${config.baseUrl}/browse/getBrowseList`, data);

// 查询期望职位列表
export const getJobExpectList = (data) => http.GET(`${config.baseUrl}/person/getJobExpectList`, data);
// 查询期望职位详情
export const getJobExpectDetail = (data) => http.GET(`${config.baseUrl}/person/getJobExpectDetail`, data);
// 新增/更新期望职位
export const updateJobExpect = (data) => http.POST(`${config.baseUrl}/person/updateJobExpect`, data);
// 删除期望职位
export const deleteJobExpectById = (data) => http.GET(`${config.baseUrl}/person/deleteJobExpectById`, data);

// 查询工作经历列表
export const getWorkExpList = (data) => http.GET(`${config.baseUrl}/person/getWorkExpList`, data);
// 查询工作经历详情
export const getWorkExpDetail = (data) => http.GET(`${config.baseUrl}/person/getWorkExpDetail`, data);
// 新增/更新工作经历
// export const updateWorkExp = (data) => http.POST(`${config.baseUrl}/person/updateWorkExp`, data);
export const updateWorkExp = (data) => http.PUT(`${config.baseUrl}/cloudUser/recruit/resume/experience/update`, data);
// 删除工作经历
export const deleteWorkExpById = (data) => http.GET(`${config.baseUrl}/person/deleteWorkExpById`, data);

// 查询项目经历列表
export const getProExpList = (data) => http.GET(`${config.baseUrl}/person/getProExpList`, data);
// 查询项目经历详情
export const getProExpDetail = (data) => http.GET(`${config.baseUrl}/person/getProExpDetail`, data);
// 新增/更新项目经历
// export const updateProExp = (data) => http.POST(`${config.baseUrl}/person/updateProExp`, data);
export const updateProExp = (data) => http.PUT(`${config.baseUrl}/cloudUser/recruit/resume/project/update`, data);
// 删除项目经历
export const deleteProExpById = (data) => http.GET(`${config.baseUrl}/person/deleteProExpById`, data);

// 查询教育经历列表
export const getEduExpList = (data) => http.GET(`${config.baseUrl}/person/getEduExpList`, data);
// 查询教育经历详情
export const getEduExpDetail = (data) => http.GET(`${config.baseUrl}/person/getEduExpDetail`, data);
// 新增/更新教育经历
// export const updateEduExp = (data) => http.POST(`${config.baseUrl}/person/updateEduExp`, data);
export const updateEduExp = (data) => http.PUT(`${config.baseUrl}/cloudUser/recruit/resume/education/update`, data);
// 删除教育经历
export const deleteEduExpById = (data) => http.GET(`${config.baseUrl}/person/deleteEduExpById`, data);

// // 用户登录
// export const postLogin = (data) => http.POST(`${config.baseUrl}/ums/xcxUserLogin`, data);

// 获取短信验证码
export const getMsgCode = (data) => http.GET(`${config.baseUrl}/register/sendMsg`, data);

// 校验注册验证码
export const postRegCode = (data) => http.POST(`${config.baseUrl}/register/verifySMSCode`, data);

// 获取卡片信息
export const getCardBin = (data) => http.GET(`${config.baseUrl}/card/getCardBin`, data);

// 图片上传
export const upload = (data) => http.POST(`${config.baseUrl}/register/upImg`, data);

// 图片下载
export const downloadImg = (data) => http.GET(`${config.baseUrl}/my/downloadImg`, data);



// 上面的都是老版本代码的接口，新版本代码写在下面



//登录
export const login = (data) => http.POST(`${config.baseUrl}/cloudUser/recruit/user/login`, data);
// 获取用户信息
export const getUserInfo = (data) => http.GET(`${config.baseUrl}/cloudUser/recruit/user/information`, data);

// 查询工作列表
export const getPositionList = (data) => http.GET(`${config.baseUrl}/cloudBusiness/recruit/position/page/keyword`, data);
// 查询高薪岗位
export const getHighPositionList = (data) => http.GET(`${config.baseUrl}/cloudBusiness/recruit/position//page/highSalary`, data);


// 查询热门工作列表
export const getHotList = (data) => http.GET(`${config.baseUrl}/cloudBusiness/recruit/position/sort`, data);

// 查询行业列表
export const getCategoryList = (data) => http.GET(`${config.baseUrl}/cloudBusiness/recruit/category`, data);

// 查询公司列表
export const getCompanyList = (data) => http.GET(`${config.baseUrl}/cloudBusiness/recruit/company/page/keyword`, data);

// /recruit/resume

// 公司其他岗位
export const getPositionByCompanyIdList = (data) => http.GET(`${config.baseUrl}/cloudBusiness/recruit/position/page/company`,data);
// 公司详情
export const getCompanyInfo = (data) => http.GET(`${config.baseUrl}/cloudBusiness/recruit/company/${id}`);

// 更新用户信息
export const updateUser = (data) => http.PUT(`${config.baseUrl}/cloudUser//recruit/user`, data);



// 查询系统消息列表(可传参{userName:})
export const getCmsList = (data) => http.GET(`${config.baseUrl}/cloudSystem/recruit/notify/all`, data);
//查询未读消息（传参：{userName:,isRead:false}）
export const getUserCms = (data) => http.GET(`${config.baseUrl}/cloudSystem/recruit/notify`, data);



// 新增应聘信息
export const addApply = (data) => http.POST(`${config.baseUrl}/cloudUser/recruit/application`, data);
// 取消应聘信息
export const deleteApply = (id) => http.DELETE(`${config.baseUrl}/cloudUser/recruit/application/${id}`);
// 获取应聘信息列表、//我的投递(参考：cloudUser/recruit/application/page/find/37?count=12&page=0)
export const getApplyList =(userId,data) => http.GET(`${config.baseUrl}/cloudUser/recruit/application/page/find/${userId}`,data);
// 是否应聘
export const getApplyFlag = (data) => http.GET(`${config.baseUrl}/cloudUser/recruit/application`, data);

export const getApplicationInfo = (data) => http.GET(`${config.baseUrl}/cloudUser/recruit/application/getApplication`, data);



// 新增收藏信息
export const addCollect = (data) => http.POST(`${config.baseUrl}/cloudUser/recruit/favor`, data);
// 删除收藏信息
export const deleteCollect = (data) => http.DELETE(`${config.baseUrl}/cloudUser/recruit/favor/cancel`, data);
// 获取我的收藏信息列表
export const getCollectList = (userId) => http.GET(`${config.baseUrl}/cloudUser/recruit/favor/${userId}`);
// 是否收藏
export const isCollect = (data) => http.GET(`${config.baseUrl}/cloudUser/recruit/favor/find`, data);


// ai对话,推荐算法
export const chatAi = (question) => http.GET(`${config.baseUrl}/cloudRecommend/recruit/chatAi/${question}`);
export const getRecommendPositionList = (question) => http.GET(`${config.baseUrl}/cloudRecommend/recruit/recommend/positionList`);

//查询简历
export const getUserResume = (userId) => http.GET(`${config.baseUrl}/cloudUser/recruit/resume/get/${userId}`);
//修改简历
export const updateResume = (userId,data) => http.PUT(`${config.baseUrl}/cloudUser/recruit/resume/${userId}`,data);
// ai
export const AIAnswer = (newMessage) => http.GET(config.baseUrl + '/cloudRecommend/recruit/chatAi/"' + newMessage + '"');




